UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1QyNYQ40FO0ouaEQKgZlkUFY/lUSZBo/0fvKWaCFzwM='
WHERE
key_id = '5028a70e305484476657fbe81fad62e59a4e316471733ef0e08ae63f9f8b28d8'
AND (
token = '1QyNYQ40FO0ouaEQKgZlkUFY/lUSZBo/0fvKWaCFzwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)