UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wx7hgZAgosjehmlEEL6OpHOF/dL/lh7iEqyeU5sPaLI=' 
WHERE 
  key_id = 'c6ed53132abb58bae244ce28aa9dc01a203953f780848b147cb76f1cd4016a36' 
  AND (
    token = 'wx7hgZAgosjehmlEEL6OpHOF/dL/lh7iEqyeU5sPaLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038