UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's+PTIIrkwnbCoyPpujcdqpPC5lKTPLkvACOKB5m+yCc='
WHERE
key_id = 'b0b9b677f5470b8a9210764b70e0112f9533006198ef62ec1a91668500200507'
AND (
token = 's+PTIIrkwnbCoyPpujcdqpPC5lKTPLkvACOKB5m+yCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)