UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BptdkJsirlEyOP0bNwbJgy6xVG5vSRLCqkzIQhP5eik=' 
WHERE 
  key_id = '7cdfd2f70e27547f65503c8a2979c66c8a087bbb71f4de2fd1cac8d829d298c7' 
  AND (
    token = 'BptdkJsirlEyOP0bNwbJgy6xVG5vSRLCqkzIQhP5eik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034