UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GGD01kOnuYTILuOfdlhOszSoDvX4Uk8O9wqWPzgI9B4=' 
WHERE 
  key_id = '1a289c610fa6664522396f5b7dc7511a157383c524b830483edcd864d3291596' 
  AND (
    token = 'GGD01kOnuYTILuOfdlhOszSoDvX4Uk8O9wqWPzgI9B4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033