UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z6WLkehP2/whdkd7Fx08+Yu8OenZB5DJiPOCfCzkals=' 
WHERE 
  key_id = '66c3c9ec756d2f3136ca814fcc9614dadbeb84bae289ead6b9bfba9255c4e534' 
  AND (
    token = 'z6WLkehP2/whdkd7Fx08+Yu8OenZB5DJiPOCfCzkals=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040