UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MF+B3RFU6YLKjQMLQuOqlyzPx2yp1VhsWdWT5h77FIU=' 
WHERE 
  key_id = 'a9d4f4e090bc46a9ddff4030ec487635d7bd06927f946a08bd2f9c75fc498d4d' 
  AND (
    token = 'MF+B3RFU6YLKjQMLQuOqlyzPx2yp1VhsWdWT5h77FIU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047