UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FbRrnm5LYie1C57BbvTFZSparL+H0h3H/ftdrhgIsrM='
WHERE
key_id = '693522a166f793df95c5226a1e21323c97740bbd9a0050179b5a9b33c4f44414'
AND (
token = 'FbRrnm5LYie1C57BbvTFZSparL+H0h3H/ftdrhgIsrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)