UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ur0xEYwNCX4+mu83HfNSQgFQieQ6PRIOdB1I0K3HaJo='
WHERE
key_id = '79357599d7dc8ae12222f1abd3b88f8a553a32c96e40d55df1e06dd257cea827'
AND (
token = 'Ur0xEYwNCX4+mu83HfNSQgFQieQ6PRIOdB1I0K3HaJo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)