UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pl5JPyNHDA4KnHSjBt9ywu2fnBkD70sEp1o6ph+ZE8s='
WHERE
key_id = '861eb817238d913dd659f4434da90017aafc0fd1c1edaa48fc8e72dc2084b9eb'
AND (
token = 'pl5JPyNHDA4KnHSjBt9ywu2fnBkD70sEp1o6ph+ZE8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)