UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3rtc3WWLJadW5QFlvqRTsrKRY5MH0EtaAJx7zDerBqw=' 
WHERE 
  key_id = '2cd425d3ae1331f5e4efc12c50ba320d003f26b371d1f4358ccda96267f4d516' 
  AND (
    token = '3rtc3WWLJadW5QFlvqRTsrKRY5MH0EtaAJx7zDerBqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022