UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UjQoljK9ee+3zrHKlRPRmc/6u5l2LLlMLP7n0AgS06c=' 
WHERE 
  key_id = '415fbfe291d19cbe1406dc43275a31ab7ce3d9ca573263f2bc8131e1beed799a' 
  AND (
    token = 'UjQoljK9ee+3zrHKlRPRmc/6u5l2LLlMLP7n0AgS06c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032