UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G6Tfd7h20mBH55TyHfFyljvocOEc/b2mP8YhxGHeAOs=' 
WHERE 
  key_id = 'c42806711d958d2f53e3777cbfb91cb4e3c6cd6e2983a294174a56d23ae49f72' 
  AND (
    token = 'G6Tfd7h20mBH55TyHfFyljvocOEc/b2mP8YhxGHeAOs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057