UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3TifTGqJYKcDy5d+aR2GZGlxAWxeWuKi2xVG41qeSPg='
WHERE
key_id = 'a3e0c35b7a06f14478fd1a37e8b4c3dd874dff465a4eec44b3b97a319b016ca8'
AND (
token = '3TifTGqJYKcDy5d+aR2GZGlxAWxeWuKi2xVG41qeSPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)