UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u6JpjHuVVXYhLTWNFR8kfgpkrrhbDQ5dZkfYr6a9M44='
WHERE
key_id = '6fa89d8bcc7e0039a5088e9dc41fbc4b1367df989d2ffeb3ca03ae59cd6706cc'
AND (
token = 'u6JpjHuVVXYhLTWNFR8kfgpkrrhbDQ5dZkfYr6a9M44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)