UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xTnAXOStwCRLeX+ESDP+wAIH9pQx+JcaKy5iMXmPocQ='
WHERE
key_id = 'e4c6e0032c3624bb37de1a4c84f3b89bfac7896b39edc518126ce50733864b8b'
AND (
token = 'xTnAXOStwCRLeX+ESDP+wAIH9pQx+JcaKy5iMXmPocQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)