UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IkEKzTWBEGNeX17ih7wyroY78cYLDXaWRk+ZnpaHV/o='
WHERE
key_id = 'f45c46a8000422bb5e5d8187ec95f5f5d197941c23d1de0aa4b95d827cc8cf5e'
AND (
token = 'IkEKzTWBEGNeX17ih7wyroY78cYLDXaWRk+ZnpaHV/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)