UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Ii3PwMnQARg6T2TcDLxkCLcc9SiA35L0zVTUv2Tyrw='
WHERE
key_id = '1b6fd4da375b4cd5139c01cc96f23caeab945e2844ce4c609618a1821c5d73bd'
AND (
token = '/Ii3PwMnQARg6T2TcDLxkCLcc9SiA35L0zVTUv2Tyrw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)