UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sluCuJsWJEBnHXfknlOEEwMfDLt6Anc0IEiI25ez/Yo='
WHERE
key_id = '32deb8a2b24c8328ec91c520005af2d6aa4ba128403334a7dbab94babd451a69'
AND (
token = 'sluCuJsWJEBnHXfknlOEEwMfDLt6Anc0IEiI25ez/Yo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)