UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZWvLXkxywqVijlHxlc+VrOe//uquN1ln9PdfQ8C2XUo='
WHERE
key_id = 'ae6589b6fa43ec8285a84961e96e40d63d01b3c97c8458e60bfb4dac772e3114'
AND (
token = 'ZWvLXkxywqVijlHxlc+VrOe//uquN1ln9PdfQ8C2XUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)