UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7VY8TNtMHIp12+0wWEU3alPgcNNXs/OGZiG0gIN14CY='
WHERE
key_id = '2841ce55136b48828c8f5983615de2d011d24271309feee3703a886c6c9d53bc'
AND (
token = '7VY8TNtMHIp12+0wWEU3alPgcNNXs/OGZiG0gIN14CY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)