UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ED7PpAPqYqyq1hCHMYnZyn+WgrGZ7jywnEDv9CHmEFI='
WHERE
key_id = '4f8f84c1bf1a1ab0e308f7db9ceb74248ea8a67c9445b75faba72f2360306632'
AND (
token = 'ED7PpAPqYqyq1hCHMYnZyn+WgrGZ7jywnEDv9CHmEFI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)