UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5TLFkqXN5E3V/FDB50IB9hgSBXA4YqWJ5AWNB7o5AcI='
WHERE
key_id = '97346f6d5b2d43b88e1cbf4122eb67030604e5aa0c9383df8adca60d943d6fd3'
AND (
token = '5TLFkqXN5E3V/FDB50IB9hgSBXA4YqWJ5AWNB7o5AcI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)