UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xfTr7JZEq8U3IXpYyV9bPpgUoWQtGvwW9e9mEbuyIq0=' 
WHERE 
  key_id = 'ff8fd0a726bdb07faf4f38a4ee25022139c3e879673ad94e3dd15e119fd933ac' 
  AND (
    token = 'xfTr7JZEq8U3IXpYyV9bPpgUoWQtGvwW9e9mEbuyIq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066