UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rhQP5WD5P+xPeaAlmje7upyhyNIN/sQYZf0CC4YjG04='
WHERE
key_id = 'c7206a58dceefc48a8291f6726356852b086c83db4bc6330baa7d516282c7225'
AND (
token = 'rhQP5WD5P+xPeaAlmje7upyhyNIN/sQYZf0CC4YjG04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)