UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mDXbq8epB7R5bO5fnIEutLWf5seBlRvz+FA4GhG1uOE='
WHERE
key_id = '57948f2a025e1ecd0a3ea18645ad2f4253cf2a40566ebae9a62993f4d41db1fc'
AND (
token = 'mDXbq8epB7R5bO5fnIEutLWf5seBlRvz+FA4GhG1uOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)