UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UlyB1eTqSdUrnX1TqJ+JIPmhkkwDT+s/AW5wwNYFqtY='
WHERE
key_id = 'a7da01700af29a70bc6bad7c744f44d95f37ba9c78412a403c95571241251dc6'
AND (
token = 'UlyB1eTqSdUrnX1TqJ+JIPmhkkwDT+s/AW5wwNYFqtY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)