UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qu6HNxI26RS77aynpKerZ77+/XeRdDe7HE+J3Y08Tjk=' 
WHERE 
  key_id = '1b63483300490226f512a88e30b09fc61687f8509dbfd8f7d4676460fcd3e3c6' 
  AND (
    token = 'Qu6HNxI26RS77aynpKerZ77+/XeRdDe7HE+J3Y08Tjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028