UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0EFHbBEhVVKxIiwXGiY/3GjZDivf1wkC1EpLv+LsDIw='
WHERE
key_id = '907a6a8c085d0d66397bbddbd8a93cabc42e3d3daea015d27d31acd7d4a1b45d'
AND (
token = '0EFHbBEhVVKxIiwXGiY/3GjZDivf1wkC1EpLv+LsDIw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)