UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9fPbkwWKt8WYMxDkWqgwuUMiKOPdfyxRwvjZSDp6yQ0=' 
WHERE 
  key_id = '695ceae835268f4d56b62157ae5aaf1570bb04fcdee53f9378363c2ab04c7959' 
  AND (
    token = '9fPbkwWKt8WYMxDkWqgwuUMiKOPdfyxRwvjZSDp6yQ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033