UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '08CcJkuM1xJj+ERNPNgRPZkwP9lCQ+gnymKKCBQknfs=' 
WHERE 
  key_id = '3218a5a78b409e22d8a67c1f9f98fc242a5d74547548b9cb87db48c540ccef44' 
  AND (
    token = '08CcJkuM1xJj+ERNPNgRPZkwP9lCQ+gnymKKCBQknfs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036