UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GT3V/4ZMjdP07mI0N08RpzcH6y7WXRhoEiaS9j8ikDY=' 
WHERE 
  key_id = 'f184917635d57937c6c73c8b7b0b9d537c1487b3837cae194e92562a69a554e7' 
  AND (
    token = 'GT3V/4ZMjdP07mI0N08RpzcH6y7WXRhoEiaS9j8ikDY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019