UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nha5+GYpcGKD/9htUaqn3fmM5WM15wFodvJ69Q6SQ0c=' 
WHERE 
  key_id = 'd4097f454843e4bbf459521c4f2d45b34c9dcaaebeb7240d8e45888b4c4da98c' 
  AND (
    token = 'nha5+GYpcGKD/9htUaqn3fmM5WM15wFodvJ69Q6SQ0c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033