UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4yAfgrHr7pqFiko3pAvoWqWm6IFVDO2/SIuq04tNFp8='
WHERE
key_id = '1b1263baec83df16d57deb88afa8633594b003c8a4cf46bfe69a0b39f55ddbcc'
AND (
token = '4yAfgrHr7pqFiko3pAvoWqWm6IFVDO2/SIuq04tNFp8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)