UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6AUVagLzyKf6+G1ugkBu6m06GInLzDc0A3/Zv1pgysw='
WHERE
key_id = 'ded36252509793b4269d82a6b56e52451e6567924615f2531009001e5f452a68'
AND (
token = '6AUVagLzyKf6+G1ugkBu6m06GInLzDc0A3/Zv1pgysw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)